package com.lxx;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lxx.async.AsyncTest;

@SpringBootApplication
@Controller
//@EnableScheduling
@ImportResource(value = { "classpath:/spring/executor.xml"})
@PropertySource(value = { "classpath:/conf/test.properties"}, ignoreResourceNotFound = true)
public class Application {

	@Autowired
	private AsyncTest asyncTest;
	
	@Value("${spring.boot.test}")
	private String test;
	@RequestMapping("/")
    @ResponseBody
    String index() {
		System.out.println(test);
		System.out.println(Thread.currentThread().getName());
		asyncTest.sendTest();
        return "Hello World";
    }
	
	/*@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder
	application) {
	return application.sources(Application.class);
	}*/

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
}

